package com.tmc.dao.impl.inthotel;

import java.util.HashMap;
import java.util.Map;

import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import com.tmc.bean.inthotel.hotel.Member;
import com.tmc.dao.impl.BaseDaoImpl;
@Repository
public class MemberDaoImpl extends BaseDaoImpl {
	
	public Member checkUsernameAndPassword(String userCode,String password){
		String sql = " from Member where userCode = :userCode and password = :password";
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("userCode", userCode);
		params.put("password", password);
		return (Member) this.get(sql, params);
	}
	
	public void saveMember(Member member){
		Session session = getSession();
		session.beginTransaction();
		session.save(member);
		session.getTransaction().commit();
	}

}
